package com.woniu.user.client;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.woniu.result.Result;
import com.woniu.user.client.param.InsertAddressParam;
import com.woniu.user.client.param.UpdateAddress;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "addressManageClient", name = "user")
public interface AddressManageClient {
    //添加地址
    @PostMapping("insertAddress")
    public Result insertAddress(@RequestBody InsertAddressParam insertAddressParam);

    //设为默认地址
    @PutMapping("defultAddress")
    public Result defultAddress(Integer addressId);

    //修改地址
    @PutMapping("updateAddress")
    public Result updateAddress(@RequestBody UpdateAddress updateAddress) throws JsonProcessingException;

    //删除地址
    @GetMapping("deleteAddress")
    public Result deleteAddress(@RequestParam("addressId") Integer addressId);
}
